(* Content-type: application/vnd.wolfram.mathematica *) (*** Wolfram Notebook File ***) (* http://www.wolfram.com/nb *) (* CreatedBy='Mathematica 10.0' *) (*CacheID: 234*) (* Internal cache information: NotebookFileLineBreakTest NotebookFileLineBreakTest NotebookDataPosition[ 158, 7] NotebookDataLength[ 7073, 225] NotebookOptionsPosition[ 6598, 204] NotebookOutlinePosition[ 6983, 221] CellTagsIndexPosition[ 6940, 218] WindowFrame->Normal*) (* Beginning of Notebook Content *) Notebook[{ Cell[BoxData[ RowBox[{"\[IndentingNewLine]", RowBox[{"(*", " ", RowBox[{ RowBox[{"Solu\[CCedilla]\[ATilde]o", " ", "de", " ", "Ax"}], "=", RowBox[{ "b", " ", "para", " ", "A", " ", "triangular", " ", "superior", " ", "e", " ", "invert\[IAcute]vel"}]}], " ", "*)"}]}]], "Input", CellChangeTimes->{{3.759865052586296*^9, 3.759865122227602*^9}}], Cell[CellGroupData[{ Cell[BoxData[{ RowBox[{ RowBox[{"A", "=", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"1", ",", "0", ",", "2"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "2", ",", RowBox[{"-", "3"}]}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "0", ",", RowBox[{"1", "/", "2"}]}], "}"}]}], "}"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"b", "=", RowBox[{"{", RowBox[{"1", ",", RowBox[{"-", "2"}], ",", "0"}], "}"}]}], ";"}], "\[IndentingNewLine]"}], "\[IndentingNewLine]", RowBox[{"If", "[", RowBox[{ RowBox[{ RowBox[{"Det", "[", "A", "]"}], "\[Equal]", "0"}], ",", RowBox[{"Print", "[", "\"\\"", "]"}]}], "]"}], "\[IndentingNewLine]", RowBox[{"MatrixForm", "[", "A", "]"}], "\[IndentingNewLine]", RowBox[{"MatrixForm", "[", "b", "]"}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"d", "=", RowBox[{"Length", "[", "b", "]"}]}], ";"}], "\[IndentingNewLine]"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"x", "=", RowBox[{"Table", "[", RowBox[{"0", ",", RowBox[{"{", RowBox[{"i", ",", "d"}], "}"}]}], "]"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{ RowBox[{"x", "[", RowBox[{"[", "d", "]"}], "]"}], "=", RowBox[{ RowBox[{"b", "[", RowBox[{"[", "d", "]"}], "]"}], "/", RowBox[{"A", "[", RowBox[{"[", RowBox[{"d", ",", "d"}], "]"}], "]"}]}]}], ";"}], "\[IndentingNewLine]"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"For", "[", RowBox[{ RowBox[{"i", "=", RowBox[{"d", "-", "1"}]}], ",", RowBox[{"i", "\[GreaterEqual]", "1"}], ",", RowBox[{"i", "--"}], ",", "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"x", "[", RowBox[{"[", "i", "]"}], "]"}], "=", RowBox[{ RowBox[{"(", RowBox[{ RowBox[{"b", "[", RowBox[{"[", "i", "]"}], "]"}], "-", RowBox[{"Sum", "[", RowBox[{ RowBox[{ RowBox[{"A", "[", RowBox[{"[", RowBox[{"i", ",", "j"}], "]"}], "]"}], " ", RowBox[{"x", "[", RowBox[{"[", "j", "]"}], "]"}]}], ",", RowBox[{"{", RowBox[{"j", ",", RowBox[{"i", "+", "1"}], ",", "d"}], "}"}]}], "]"}]}], ")"}], "/", RowBox[{"A", "[", RowBox[{"[", RowBox[{"i", ",", "i"}], "]"}], "]"}]}]}], ";"}]}], "\[IndentingNewLine]", "]"}], "\[IndentingNewLine]"}], "\[IndentingNewLine]", RowBox[{"MatrixForm", "[", "x", "]"}], "\[IndentingNewLine]"}], "Input", CellChangeTimes->{{3.75986510543792*^9, 3.759865135638155*^9}, { 3.759865166948545*^9, 3.7598654008794317`*^9}, {3.759865441444305*^9, 3.759865620445764*^9}, {3.759865715410482*^9, 3.7598657762055197`*^9}, { 3.7598658535178432`*^9, 3.7598659104550133`*^9}, {3.759865944183737*^9, 3.759866074810635*^9}, 3.7598661952558603`*^9, {3.759866293741538*^9, 3.759866297958749*^9}, 3.7598664597623167`*^9, {3.759866495222694*^9, 3.7598664956598587`*^9}}], Cell[BoxData[ TagBox[ RowBox[{"(", "\[NoBreak]", GridBox[{ {"1", "0", "2"}, {"0", "2", RowBox[{"-", "3"}]}, {"0", "0", FractionBox["1", "2"]} }, GridBoxAlignment->{ "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, "Rows" -> {{Baseline}}, "RowsIndexed" -> {}}, GridBoxSpacings->{"Columns" -> { Offset[0.27999999999999997`], { Offset[0.7]}, Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> { Offset[0.2], { Offset[0.4]}, Offset[0.2]}, "RowsIndexed" -> {}}], "\[NoBreak]", ")"}], Function[BoxForm`e$, MatrixForm[BoxForm`e$]]]], "Output", CellChangeTimes->{ 3.759866076168499*^9, {3.759866189506975*^9, 3.759866196943046*^9}, 3.759866299179186*^9, 3.759866460559197*^9, 3.7598665133269367`*^9}], Cell[BoxData[ TagBox[ RowBox[{"(", "\[NoBreak]", TagBox[GridBox[{ {"1"}, { RowBox[{"-", "2"}]}, {"0"} }, GridBoxAlignment->{ "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, "Rows" -> {{Baseline}}, "RowsIndexed" -> {}}, GridBoxSpacings->{"Columns" -> { Offset[0.27999999999999997`], { Offset[0.5599999999999999]}, Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> { Offset[0.2], { Offset[0.4]}, Offset[0.2]}, "RowsIndexed" -> {}}], Column], "\[NoBreak]", ")"}], Function[BoxForm`e$, MatrixForm[BoxForm`e$]]]], "Output", CellChangeTimes->{ 3.759866076168499*^9, {3.759866189506975*^9, 3.759866196943046*^9}, 3.759866299179186*^9, 3.759866460559197*^9, 3.759866513334702*^9}], Cell[BoxData[ TagBox[ RowBox[{"(", "\[NoBreak]", TagBox[GridBox[{ {"1"}, { RowBox[{"-", "1"}]}, {"0"} }, GridBoxAlignment->{ "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, "Rows" -> {{Baseline}}, "RowsIndexed" -> {}}, GridBoxSpacings->{"Columns" -> { Offset[0.27999999999999997`], { Offset[0.5599999999999999]}, Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> { Offset[0.2], { Offset[0.4]}, Offset[0.2]}, "RowsIndexed" -> {}}], Column], "\[NoBreak]", ")"}], Function[BoxForm`e$, MatrixForm[BoxForm`e$]]]], "Output", CellChangeTimes->{ 3.759866076168499*^9, {3.759866189506975*^9, 3.759866196943046*^9}, 3.759866299179186*^9, 3.759866460559197*^9, 3.759866513339657*^9}] }, Open ]] }, WindowSize->{808, 911}, WindowMargins->{{4, Automatic}, {Automatic, 4}}, Magnification:>1.5 Inherited, FrontEndVersion->"10.0 for Mac OS X x86 (32-bit, 64-bit Kernel) (December 4, \ 2014)", StyleDefinitions->"Default.nb" ] (* End of Notebook Content *) (* Internal cache information *) (*CellTagsOutline CellTagsIndex->{} *) (*CellTagsIndex CellTagsIndex->{} *) (*NotebookFileOutline Notebook[{ Cell[558, 20, 370, 8, 94, "Input"], Cell[CellGroupData[{ Cell[953, 32, 3145, 92, 469, "Input"], Cell[4101, 126, 827, 23, 118, "Output"], Cell[4931, 151, 824, 24, 108, "Output"], Cell[5758, 177, 824, 24, 108, "Output"] }, Open ]] } ] *) (* End of internal cache information *)